using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class SacculusMagMap : EntityTypeConfiguration<SacculusMag>
    {
        public SacculusMagMap()
        {
            // Primary Key
            this.HasKey(t => t.SM_ID);

            // Properties
            this.Property(t => t.SM_Name)
                .HasMaxLength(50);

            this.Property(t => t.SM_Firm)
                .HasMaxLength(100);

            this.Property(t => t.SM_Model)
                .HasMaxLength(100);

            this.Property(t => t.SM_Diameter)
                .HasMaxLength(20);

            this.Property(t => t.SM_Long)
                .HasMaxLength(20);

            this.Property(t => t.SM_Ate)
                .HasMaxLength(20);

            this.Property(t => t.SM_Sec)
                .HasMaxLength(20);

            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.HospitalId)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("SacculusMag");
            this.Property(t => t.SM_ID).HasColumnName("SM_ID");
            this.Property(t => t.SM_Name).HasColumnName("SM_Name");
            this.Property(t => t.SM_Firm).HasColumnName("SM_Firm");
            this.Property(t => t.SM_Model).HasColumnName("SM_Model");
            this.Property(t => t.SM_Diameter).HasColumnName("SM_Diameter");
            this.Property(t => t.SM_Long).HasColumnName("SM_Long");
            this.Property(t => t.SM_Ate).HasColumnName("SM_Ate");
            this.Property(t => t.SM_Sec).HasColumnName("SM_Sec");
            this.Property(t => t.SM_Count).HasColumnName("SM_Count");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.TTL_ID).HasColumnName("TTL_ID");
            this.Property(t => t.HospitalId).HasColumnName("HospitalId");
            this.Property(t => t.State).HasColumnName("State");
            this.Property(t => t.SM_SID).HasColumnName("SM_SID");
            this.Property(t => t.DiameterID).HasColumnName("DiameterID");
        }
    }
}
